Work around Zope Interface package's new-style class/metaclass bug
Use this as a metaclass of any new-style class you'd like to have
properly support __implements__ and __class_implements__ , as
current versions of the Zope Interface package can't tell that
a metaclass instance is really a class-like thing.
Basically, this does two tricks. First, it converts any
__implements__ value in the class dictionary to an
interfaceAssertion attribute descriptor. Second, it provides
instancesImplements and instancesImplement methods to its
instances, so that when looking for isImplementedByInstancesOf ,
the Interface package will get the right thing. There are two
spellings of the method because the Zope 2.x and Zope 3X versions
of the package spell it differently. :(
Methods
|
|
__init__
instancesImplements
|
|
__init__
|
__init__ (
klass,
name,
bases,
dict,
)
Convert __implements__ to a descriptor
|
|
instancesImplements
|
instancesImplements ( klass )
Tell Interface what our (non-metaclass) instances implement
|
|